﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OracleClient;
using ReflectionStudio.Core.Events;
using INTEX.DataBase;
using INTEX.DataBase.Tools;
using Intex.Tools;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{

    public class JLTVKAV95Data : BaseFunction
    {
        public bool checkVK07 = true;
        SETINTEXDB INTEXDB = new SETINTEXDB();
        private Convert2Intex Convert2Intex;
        public DataSet SetCAD;
        INTEXDBC INTEXDBC;
        public JLTVKAV95Data()
            : base()
        {

        }
        public JLTVKAV95Data(OracleConnection _myConnection, IntexReptServBLClient _proxy, string userID = "        ")
            : base(_myConnection, _proxy, userID)
        {
            INTEXDBC = new INTEXDBC(OracleDB, proxy);
            
        }
        public JLTVKAV95Data(Dictionary<string, object> DicGlobalPara)
            : base(DicGlobalPara)
        {
            INTEXDBC = new INTEXDBC(OracleDB, proxy);
        }
        public DataSet GetData(DataRow dwInput)
        {
            DataSet SReturn = new DataSet();
            DataSet SResult = new DataSet();

            try
            {
                DataRow dwTemp;                   
                
                dwTemp = INTEXDB.ICC_VKAV95.NewRow();
                dwTemp["VKPMANDANT"] = dwInput["VKPMANDANT"];
                dwTemp["VKPAUFKRS"] = dwInput["VKPAUFKRS"];
                INTEXDBC.InsertICC_VKAV95(dwTemp, 1);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 2);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 3);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 4);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 5);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 6);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 7);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 8);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 9);
                INTEXDBC.UpdateICC_VKAV95(dwTemp, 9999);
                SResult = INTEXDBC.QueryICC_VKAV95(dwTemp, 1);
                SReturn.Merge(SResult);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            finally
            {
                EventDispatcher.Instance.RaiseStatus("查询完成", StatusEventType.StopProgress);
            }
            return SReturn;
        } 
    }
}